export default class downloadInfo {
  constructor(obj: any) {
    this._title = obj.title;
    this._cover = obj.cover;
    this._epTitle = obj.epTitle;
    this._cid = obj.cid.toString();
    this._epId = obj.epId.toString();
  }

  public addEp(obj: any) {
    this._title = obj.title;
    this._cover = obj.cover;
    this._epTitle = obj.epTitle;
    this._cid = obj.cid.toString();
    this._epId = obj.epId.toString();
  }

  private _cid: string;

  public get cid() {
    return this._cid;
  }

  private _epId: string;

  public get epId() {
    return this._epId;
  }

  private _epTitle: string;

  public get epTitle() {
    return this._epTitle;
  }

  private _title: string;

  public get title() {
    return this._title;
  }

  private _cover: string;

  public get cover() {
    return this._cover;
  }

  public toString() {
    return JSON.stringify({
      'cid': this.cid,
      'title': this.title,
      'cover': this.cover
    });
  }

  public toEpString() {
    return JSON.stringify({
      'cid': this.cid,
      'epId': this.epId,
      'title': this.epTitle
    });
  }
}